//
//  UIView+EVCornerRadius.m
//  EVClub
//
//  Created by LiJieming on 14/12/5.
//  Copyright (c) 2014年 BitRice. All rights reserved.
//

#import "UIView+EVCornerRadius.h"

@implementation UIView (EVCornerRadius)

- (void)ev_setCornerRadius:(CGFloat)cornerRadius {
    self.layer.cornerRadius = cornerRadius;
    if (cornerRadius > 0) {
        self.layer.masksToBounds = YES;
    }
}

- (void)setEv_cornerRadius:(CGFloat)cornerRadius
{
    [self ev_setCornerRadius:cornerRadius];
}

- (CGFloat)ev_cornerRadius {
    return self.layer.cornerRadius;
}

- (void)ev_setBorderWidth:(CGFloat)borderWidth {
    self.layer.borderWidth = borderWidth;
}

- (void)setEv_borderWidth:(CGFloat)borderWidth
{
    [self ev_setBorderWidth:borderWidth];
}

- (CGFloat)ev_borderWidth {
    return self.layer.borderWidth;
}

- (void)ev_setBorderColor:(UIColor *)borderColor {
    self.layer.borderColor = borderColor.CGColor;
}

- (void)setEv_borderColor:(UIColor *)borderColor
{
    [self ev_setBorderColor:borderColor];
}

- (UIColor *)ev_borderColor {
    return [UIColor colorWithCGColor:self.layer.borderColor];
}

@end
